.class public Lnbisdk/gl;
.super Ljava/lang/Object;

# interfaces
.implements Lnbisdk/ed;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lnbisdk/gl$b;,
        Lnbisdk/gl$a;
    }
.end annotation


# instance fields
.field private TAG:Ljava/lang/String;

.field protected tk:Lnbisdk/qz;

.field protected tl:Ljava/lang/String;

.field protected volatile tm:I

.field protected tn:Z

.field protected to:Z


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "NIMSTORE"

    iput-object v0, p0, Lnbisdk/gl;->TAG:Ljava/lang/String;

    :try_start_0
    new-instance v0, Lnbisdk/qz;

    invoke-direct {v0, p1}, Lnbisdk/qz;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    iput-object p2, p0, Lnbisdk/gl;->tl:Ljava/lang/String;
    :try_end_0
    .catch Lnbisdk/an; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lnbisdk/an;->printStackTrace()V

    goto :goto_0
.end method

.method public static q(Lnbisdk/fk;)Lnbisdk/ew;
    .locals 5

    new-instance v0, Lnbisdk/ew;

    invoke-direct {v0}, Lnbisdk/ew;-><init>()V

    const-string v1, "price"

    invoke-static {p0, v1}, Lnbisdk/ij$a;->c(Lnbisdk/fk;Ljava/lang/String;)Lnbisdk/fk;

    move-result-object v1

    new-instance v2, Lnbisdk/md;

    invoke-direct {v2}, Lnbisdk/md;-><init>()V

    const-string v3, "value"

    invoke-static {v1, v3}, Lnbisdk/el;->a(Lnbisdk/fk;Ljava/lang/String;)D

    move-result-wide v3

    invoke-virtual {v2, v3, v4}, Lnbisdk/md;->o(D)V

    const-string v3, "currency"

    invoke-static {v1, v3}, Lnbisdk/ok;->j(Lnbisdk/fk;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnbisdk/md;->aq(Ljava/lang/String;)V

    const-string v3, "modtime"

    invoke-virtual {v1, v3}, Lnbisdk/fk;->U(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    const-string v3, "modtime"

    invoke-static {v1, v3}, Lnbisdk/ka;->b(Lnbisdk/fk;Ljava/lang/String;)J

    move-result-wide v3

    invoke-virtual {v2, v3, v4}, Lnbisdk/md;->g(J)V

    :cond_0
    invoke-virtual {v0, v2}, Lnbisdk/ew;->a(Lnbisdk/md;)V

    const-string v1, "units"

    invoke-virtual {p0, v1}, Lnbisdk/fk;->U(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    const-string v1, "units"

    invoke-static {p0, v1}, Lnbisdk/ok;->j(Lnbisdk/fk;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lnbisdk/ew;->R(Ljava/lang/String;)V

    :cond_1
    const-string v1, "fuel-type"

    invoke-static {p0, v1}, Lnbisdk/ij$a;->e(Lnbisdk/fk;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_5

    const-string v1, "fuel-type"

    invoke-static {p0, v1}, Lnbisdk/ij$a;->c(Lnbisdk/fk;Ljava/lang/String;)Lnbisdk/fk;

    move-result-object v1

    new-instance v2, Lnbisdk/gy;

    invoke-direct {v2}, Lnbisdk/gy;-><init>()V

    const-string v3, "product-name"

    invoke-virtual {v1, v3}, Lnbisdk/fk;->U(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_2

    const-string v3, "product-name"

    invoke-static {v1, v3}, Lnbisdk/ok;->j(Lnbisdk/fk;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnbisdk/gy;->X(Ljava/lang/String;)V

    :cond_2
    const-string v3, "code"

    invoke-virtual {v1, v3}, Lnbisdk/fk;->U(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_3

    const-string v3, "code"

    invoke-static {v1, v3}, Lnbisdk/ok;->j(Lnbisdk/fk;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnbisdk/gy;->Z(Ljava/lang/String;)V

    :cond_3
    const-string v3, "type-name"

    invoke-virtual {v1, v3}, Lnbisdk/fk;->U(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_4

    const-string v3, "type-name"

    invoke-static {v1, v3}, Lnbisdk/ok;->j(Lnbisdk/fk;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Lnbisdk/gy;->Y(Ljava/lang/String;)V

    :cond_4
    invoke-virtual {v0, v2}, Lnbisdk/ew;->a(Lnbisdk/gy;)V

    :cond_5
    const-string v1, "average"

    invoke-static {p0, v1}, Lnbisdk/ij$a;->e(Lnbisdk/fk;Ljava/lang/String;)Z

    move-result v1

    invoke-virtual {v0, v1}, Lnbisdk/ew;->q(Z)V

    const-string v1, "low"

    invoke-static {p0, v1}, Lnbisdk/ij$a;->e(Lnbisdk/fk;Ljava/lang/String;)Z

    move-result v1

    invoke-virtual {v0, v1}, Lnbisdk/ew;->r(Z)V

    return-object v0
.end method


# virtual methods
.method public final B(I)[B
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    const/4 v3, 0x0

    iget-boolean v0, p0, Lnbisdk/gl;->tn:Z

    if-nez v0, :cond_0

    new-instance v0, Lnbisdk/an;

    const-string v1, "Store Closed"

    invoke-direct {v0, v1}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    :try_start_0
    iget-object v0, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v0}, Lnbisdk/qz;->getDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "SELECT value  FROM \'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lnbisdk/gl;->tl:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\' WHERE id = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_1

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v1

    :goto_0
    invoke-interface {v0}, Landroid/database/Cursor;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object v1

    :catch_0
    move-exception v0

    new-instance v1, Lnbisdk/an;

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v1

    :cond_1
    move-object v1, v3

    goto :goto_0
.end method

.method public final O(I)V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    iget-boolean v0, p0, Lnbisdk/gl;->tn:Z

    if-nez v0, :cond_0

    new-instance v0, Lnbisdk/an;

    const-string v1, "Store Closed"

    invoke-direct {v0, v1}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    :try_start_0
    iget-object v0, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v0}, Lnbisdk/qz;->getDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "\'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lnbisdk/gl;->tl:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "id ="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v2, v3}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_0
    .catch Landroid/database/sqlite/SQLiteException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public final a(Lnbisdk/jt;)Lnbisdk/cl;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    iget-boolean v0, p0, Lnbisdk/gl;->to:Z

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lnbisdk/gl;->tn:Z

    if-nez v0, :cond_1

    :cond_0
    new-instance v0, Lnbisdk/an;

    const-string v1, "Store Closed"

    invoke-direct {v0, v1}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    new-instance v0, Lnbisdk/gl$b;

    invoke-direct {v0, p0, p1}, Lnbisdk/gl$b;-><init>(Lnbisdk/gl;Lnbisdk/jt;)V

    return-object v0
.end method

.method public final aK()I
    .locals 4

    const/4 v3, 0x0

    iget-boolean v0, p0, Lnbisdk/gl;->to:Z

    if-eqz v0, :cond_0

    :try_start_0
    iget-object v0, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v0}, Lnbisdk/qz;->getDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "SELECT COUNT(id) FROM \'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lnbisdk/gl;->tl:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_1

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    :goto_0
    invoke-interface {v0}, Landroid/database/Cursor;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move v0, v1

    :goto_1
    return v0

    :catch_0
    move-exception v0

    :cond_0
    move v0, v3

    goto :goto_1

    :cond_1
    move v1, v3

    goto :goto_0
.end method

.method public final b(I[BII)V
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    iget-boolean v0, p0, Lnbisdk/gl;->tn:Z

    if-nez v0, :cond_0

    new-instance v0, Lnbisdk/an;

    const-string v1, "Store Closed"

    invoke-direct {v0, v1}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    :try_start_0
    iget v0, p0, Lnbisdk/gl;->tm:I

    if-lt p1, v0, :cond_1

    invoke-virtual {p0, p2}, Lnbisdk/gl;->e([B)I

    :goto_0
    return-void

    :cond_1
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    const-string v1, "value"

    invoke-virtual {v0, v1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;[B)V

    iget-object v1, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v1}, Lnbisdk/qz;->getDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "\'"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lnbisdk/gl;->tl:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\'"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const-string v3, "id=?"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-virtual {v1, v2, v0, v3, v4}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    new-instance v1, Lnbisdk/an;

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public final clear()V
    .locals 3

    iget-boolean v0, p0, Lnbisdk/gl;->tn:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Lnbisdk/gl;->TAG:Ljava/lang/String;

    const-string v1, "nimstore closed or not exist"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :goto_0
    return-void

    :cond_0
    :try_start_0
    iget-object v0, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v0}, Lnbisdk/qz;->getDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "DROP TABLE \'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lnbisdk/gl;->tl:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/database/sqlite/SQLiteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    new-instance v1, Lnbisdk/an;

    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteException;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public final close()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    iget-object v0, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v0}, Lnbisdk/qz;->close()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/gl;->tn:Z

    return-void
.end method

.method public final e([B)I
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    iget-boolean v0, p0, Lnbisdk/gl;->tn:Z

    if-nez v0, :cond_0

    new-instance v0, Lnbisdk/an;

    const-string v1, "Store Closed"

    invoke-direct {v0, v1}, Lnbisdk/an;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    :try_start_0
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    const-string v1, "value"

    invoke-virtual {v0, v1, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;[B)V

    iget-object v1, p0, Lnbisdk/gl;->tk:Lnbisdk/qz;

    invoke-virtual {v1}, Lnbisdk/qz;->getDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "\'"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lnbisdk/gl;->tl:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\'"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3, v0}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J
    :try_end_0
    .catch Landroid/database/sqlite/SQLiteException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-wide v0

    long-to-int v0, v0

    :goto_0
    return v0

    :catch_0
    move-exception v0

    const/4 v0, -0x1

    goto :goto_0
.end method

.method final jC()Z
    .locals 1

    iget-boolean v0, p0, Lnbisdk/gl;->to:Z

    return v0
.end method
